package com.isoft.farm.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserRoleDao {
    int insertObjects(
            @Param("userId") Integer userId,
            @Param("roleIds") Integer[] roleIds
    );
    //通过用户Id查询角色id
    List<Integer> findRoleIdByUserId(Integer id);
    int deleteObjectsByUserId(Integer id);

    /**
     * 根据角色Id删除数据
     * @param id
     * @return
     */
    @Delete("delete from sys_user_roles where role_id=#{roleId}")
    int deleteObjectsByRoleId(Integer id);
}
